home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 09-22.C < prev    next >
Text File  |  1991-05-06  |  926b  |  45 lines

  1. main()
  2. {
  3.    int row;
  4.    int new_mode, old_mode;
  5.    char string[21];
  6.  
  7.    new_mode = fg_bestmode(320,200,2);
  8.    if (new_mode < 0 || new_mode == 12) {
  9.       printf("This program requires a 320 ");
  10.       printf("x 200 color graphics mode.\n");
  11.       exit();
  12.       }
  13.    old_mode = fg_getmode();
  14.    fg_setmode(new_mode);
  15.  
  16.    fg_setcolor(7);
  17.    fg_rect(0,319,0,199);
  18.    fg_setcolor(9);
  19.  
  20.    for (row = 0; row < 25; row++) {
  21.       sprintf(string,"   This is row %2d   ",row);
  22.       fg_locate(row,0);
  23.       fg_text(string,20);
  24.       fg_text(string,20);
  25.       }
  26.    fg_waitkey();
  27.  
  28.    fg_allocate(1);
  29.    fg_sethpage(1);
  30.    fg_save(96,223,88,111);
  31.    fg_setcolor(1);
  32.    fg_rect(96,223,88,111);
  33.    fg_setcolor(15);
  34.    fg_locate(12,13);
  35.    fg_text("Press any key.",14);
  36.    fg_waitkey();
  37.  
  38.    fg_restore(96,223,88,111);
  39.    fg_waitkey();
  40.  
  41.    fg_freepage(1);
  42.    fg_setmode(old_mode);
  43.    fg_reset();
  44. }
  45.